//
//  AboutViewController.m
//  XDLookPic
//
//  Created by maboyi on 14-5-29.
//  Copyright (c) 2014年 XD-XY. All rights reserved.
//

#import "AboutViewController.h"
#define mbyTextColor   UIColorFromRGB(0x666666)

@interface AboutViewController ()

@end

@implementation AboutViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}



- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.titleLabel.text = @"关于喵贷信用支付";
	
    UIImageView * logoIV = [[UIImageView alloc] initWithFrame:CGRectMake((320-437/2.0f)/2.0f, 30, 437/2.0f, 93/2.0f)];
    logoIV.image = [UIImage imageNamed:@"about_logo"];
    [self.contentView addSubview:logoIV];

    NSString *oldVerson = [[NSString alloc] initWithString:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]];

    UILabel * lab = [XDTools addAlabelForAView:self.contentView withText:oldVerson frame:CGRectMake(100, height_y(logoIV) + 10, 120, 20) font:[UIFont systemFontOfSize:18] textColor:RGBA(245, 170, 87, 1)];
    lab.textAlignment = NSTextAlignmentCenter;

    NSString * str = @"喵贷，小而快的信贷，年轻人专属的信贷购物软件。不需要收入证明，不需要任何抵押，只要你有手机号，你就可以凭“我诚信，我借贷”完成你人生中第一笔信贷业务。我们给你的不仅仅是一笔信用贷款，更是给你梦想起飞动力！\n\n功能如下：\n1，合作商户快捷手机充值，全网最低价，给自己给别人充值就这么便宜快捷。\n2，魔游游游戏支付，支持超过300余款热门手机网游。\n3，CJ礼物信用领取，一键信用支付，当场领取心仪礼物。\n4，一键还款，随时维护你的信用体系。";

    UILabel * label = [XDTools addAlabelForAView:self.contentView withText:str frame:CGRectMake(20, height_y(logoIV) + 60, 280, 200) font:[UIFont systemFontOfSize:15] textColor:[UIColor blackColor]];
    [label sizeToFit];

    NSArray * contentArray = [NSArray arrayWithObjects:oldVerson,@"北京乐宠科技有限公司",@"版权所有", nil];
    //@"北京新道浩达科技有限公司"
    int height = 0;
    if (!IOS7) {
        height = 96;
    }

    NSArray * arr = [NSArray arrayWithObjects:@"喵贷信用支付介绍",@"喵贷官网",@"协议及声明", nil];
    for (int i = 0; i < 3; i++) {


    }
    
//    UIImageView * xindaoIV = [[UIImageView alloc] initWithFrame:CGRectMake(58, UI_MAINSCREEN_HEIGHT - UI_NAVIGATION_BAR_HEIGHT - 49 - 29/2, 109/2, 29/2)];
//    xindaoIV.image = [UIImage imageNamed:@"xindaoLogo"];
//    [self.contentView addSubview:xindaoIV];
//    
//    UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(width_x(xindaoIV)+10, xindaoIV.frame.origin.y, 200, 29/2)];
//    label.text = @"北京新道浩达科技有限公司";
//    label.font = [UIFont systemFontOfSize:13];
//    label.textColor = RGBA(74, 143, 217, 1);
//    label.userInteractionEnabled = YES;
//    label.backgroundColor = [UIColor clearColor];
//    [self.contentView addSubview:label];
//    
//    UIButton * btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
//    btn1.frame = CGRectMake(0, 0, UI_SCREEN_WIDTH, label.frame.size.height);
//    btn1.backgroundColor = [UIColor clearColor];
//    btn1.tag = 11101;
//    [btn1 addTarget:self action:@selector(openUrl:) forControlEvents:UIControlEventTouchUpInside];
//    [label addSubview:btn1];
}

- (void)openUrl:(UIButton *)sender{
    if (sender.tag == 11101) {
        NSString * path=[NSString stringWithFormat:@"http://www.xindaoapp.com"];
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:path]];
    }else if(sender.tag == 11002) {
        //        NSString * path=[NSString stringWithFormat:@"http://www.cipeasia.com"];
        //        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:path]];
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
